package data;

import java.awt.Color;
import java.awt.Graphics;

import sprites.Sprite;
import sprites.SpriteMap;

public class ImageVisual implements visualizzation {


	@Override
	public void drawDart(Graphics graphics, Dart d) {
		Sprite sprite = SpriteMap.get().getSprite(d.getSpritePath());
		sprite.draw(graphics, d.getX() - (d.getDartSize() >> 1), d.getY()
				- (d.getDartSize() >> 1));

	}

	@Override
	public void drawPlayer(Graphics graphics, Player p) {
		String a = new String();
		switch (p.getTeam()) {
		case 0:
			a = "sprites/6b.gif";
			break;
		case 1:
			a = "sprites/5b.gif";
			break;
		case 2:
			a = "sprites/4b.gif";
			break;
		case 3:
			a = "sprites/3b.gif";
			break;
		default:
			a = "sprites/6b.gif";
		}

		Sprite sprite = SpriteMap.get().getSprite(a);
		sprite.draw(graphics, p.getPosition().getX(), p.getPosition().getY());
		graphics.setColor(Color.yellow);
		p.writePlayerInfo(graphics);
	}
	@Override
	public void drawBG(Graphics graphics, GameLoop gl) {
		graphics.drawImage(SpriteMap.get().getSprite("sprites/sfondo.gif").getImage(), 0, 0, null);
		
	}
	


}
